<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
    <title>我的活动</title>
    <link rel="stylesheet" href="css/wap/main.css"/>
</head>
<body>
    <div class="classify_name activity exchange">
        <ul>
            <li>
                <a href=""><img src="images/wap/xingzuo/exchange_4.png" /></a>
                <div>
                    <h3>解锁12星座，1元购</h3>
                    <p>解锁12星座，1元兑换商品，可重复兑换</p>
                    <img src="images/wap/xingzuo/xz_right.png" alt="">
                </div>
            </li>
            <li>
                <a href=""><img src="images/wap/xingzuo/exchange_4.png" /></a>
                <div>
                    <h3>解锁12星座，1元购</h3>
                    <p>解锁12星座，1元兑换商品，可重复兑换</p>
                    <img src="images/wap/xingzuo/xz_right.png" alt="">
                </div>
            </li>
            <li>
                <a href=""><img src="images/wap/xingzuo/exchange_4.png" /></a>
                <div>
                    <h3>解锁12星座，1元购</h3>
                    <p>解锁12星座，1元兑换商品，可重复兑换</p>
                    <img src="images/wap/xingzuo/xz_right.png" alt="">
                </div>
            </li>
        </ul>
    </div>
    <script src="js/jquery-1.8.3.min.js"></script>
    <script>
    $(function(){
        $.ajax({
            url:"data/exchange.json",
            type:"GET",
            success:function(data){
                // console.log(data);
                if(data[1].length===0){
                    $('.exchange+.noRecode').css({"display": "block"});                    
                }
                var str='';
                for(var i=0;i<data[1].length;i++){
                    var strLi=
                    '<li><a href=""><img src="images/wap/xingzuo/'+data[1][i].pic+'" /></a><div><h3>'+data[1][i].name+'</h3><p>解锁12星座，1元兑换商品，可重复兑换</p><img src="images/wap/xingzuo/xz_right.png" alt=""></div></li>';
                    str+=strLi;
                }
                // console.log(str);
                $('.activity ul').html(str);
            },
            error:function(){
                alert('error');
            }
        });
    })
    </script>
</body>
</html>























